import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GeneratedPluginRegistrant.register(with: self)
    //主动请求原生网络请求，获取网络权限
    req();
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

func req() {
    let task = URLSession.shared.dataTask(with: URLRequest(url: URL(string: "https://www.baidu.com")!)) { _, _, err in
        print("网络 err:\(err)")
    }
    task.resume()
}
